Optimal. Leaf size=101 \[ -\frac {2 a^3 (i A-B) c^2 (1+i \tan (e+f x))^3}{3 f}+\frac {a^3 (i A-3 B) c^2 (1+i \tan (e+f x))^4}{4 f}+\frac {a^3 B c^2 (1+i \tan (e+f x))^5}{5 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {a^3 c^2 (-3 B+i A) (1+i \tan (e+f x))^4}{4 f}-\frac {2 a^3 c^2 (-B+i A) (1+i \tan (e+f x))^3}{3 f}+\frac {a^3 B c^2 (1+i \tan (e+f x))^5}{5 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^3 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx &=\frac {(a c) \text {Subst}\left (\int (a+i a x)^2 (A+B x) (c-i c x) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (2 (A+i B) c (a+i a x)^2-\frac {(A+3 i B) c (a+i a x)^3}{a}+\frac {i B c (a+i a x)^4}{a^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {2 a^3 (i A-B) c^2 (1+i \tan (e+f x))^3}{3 f}+\frac {a^3 (i A-3 B) c^2 (1+i \tan (e+f x))^4}{4 f}+\frac {a^3 B c^2 (1+i \tan (e+f x))^5}{5 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.43, size = 146, normalized size = 1.45 \begin {gather*} \frac {a^3 c^2 \sec (e) \sec ^5(e+f x) (15 (i A+B) \cos (f x)+15 (i A+B) \cos (2 e+f x)+35 A \sin (f x)+5 i B \sin (f x)-15 A \sin (2 e+f x)+15 i B \sin (2 e+f x)+25 A \sin (2 e+3 f x)-5 i B \sin (2 e+3 f x)+5 A \sin (4 e+5 f x)-i B \sin (4 e+5 f x))}{120 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 94, normalized size = 0.93
method | result | size |
derivativedivides | \(\frac {i c^{2} a^{3} \left (\frac {B \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {\left (-i B +A \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4}+\frac {\left (i A -2 i \left (i B +A \right )-B \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (-i B +A \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}-i A \tan \left (f x +e \right )\right )}{f}\) | \(94\) |
default | \(\frac {i c^{2} a^{3} \left (\frac {B \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {\left (-i B +A \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4}+\frac {\left (i A -2 i \left (i B +A \right )-B \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (-i B +A \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}-i A \tan \left (f x +e \right )\right )}{f}\) | \(94\) |
risch | \(\frac {4 c^{2} a^{3} \left (30 i A \,{\mathrm e}^{6 i \left (f x +e \right )}+30 B \,{\mathrm e}^{6 i \left (f x +e \right )}+50 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+10 B \,{\mathrm e}^{4 i \left (f x +e \right )}+25 i A \,{\mathrm e}^{2 i \left (f x +e \right )}+5 B \,{\mathrm e}^{2 i \left (f x +e \right )}+5 i A +B \right )}{15 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{5}}\) | \(106\) |
norman | \(\frac {A \,a^{3} c^{2} \tan \left (f x +e \right )}{f}+\frac {\left (i A \,a^{3} c^{2}+B \,a^{3} c^{2}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {\left (i A \,a^{3} c^{2}+B \,a^{3} c^{2}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}+\frac {\left (i B \,a^{3} c^{2}+A \,a^{3} c^{2}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {i B \,a^{3} c^{2} \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}\) | \(136\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.56, size = 110, normalized size = 1.09 \begin {gather*} \frac {12 i \, B a^{3} c^{2} \tan \left (f x + e\right )^{5} - 15 \, {\left (-i \, A - B\right )} a^{3} c^{2} \tan \left (f x + e\right )^{4} + 20 \, {\left (A + i \, B\right )} a^{3} c^{2} \tan \left (f x + e\right )^{3} - 30 \, {\left (-i \, A - B\right )} a^{3} c^{2} \tan \left (f x + e\right )^{2} + 60 \, A a^{3} c^{2} \tan \left (f x + e\right )}{60 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 8.00, size = 160, normalized size = 1.58 \begin {gather*} -\frac {4 \, {\left (30 \, {\left (-i \, A - B\right )} a^{3} c^{2} e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, {\left (-5 i \, A - B\right )} a^{3} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, {\left (-5 i \, A - B\right )} a^{3} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-5 i \, A - B\right )} a^{3} c^{2}\right )}}{15 \, {\left (f e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 250 vs. \(2 (80) = 160\).
time = 0.48, size = 250, normalized size = 2.48 \begin {gather*} \frac {20 i A a^{3} c^{2} + 4 B a^{3} c^{2} + \left (100 i A a^{3} c^{2} e^{2 i e} + 20 B a^{3} c^{2} e^{2 i e}\right ) e^{2 i f x} + \left (200 i A a^{3} c^{2} e^{4 i e} + 40 B a^{3} c^{2} e^{4 i e}\right ) e^{4 i f x} + \left (120 i A a^{3} c^{2} e^{6 i e} + 120 B a^{3} c^{2} e^{6 i e}\right ) e^{6 i f x}}{15 f e^{10 i e} e^{10 i f x} + 75 f e^{8 i e} e^{8 i f x} + 150 f e^{6 i e} e^{6 i f x} + 150 f e^{4 i e} e^{4 i f x} + 75 f e^{2 i e} e^{2 i f x} + 15 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 203 vs. \(2 (88) = 176\).
time = 0.81, size = 203, normalized size = 2.01 \begin {gather*} -\frac {4 \, {\left (-30 i \, A a^{3} c^{2} e^{\left (6 i \, f x + 6 i \, e\right )} - 30 \, B a^{3} c^{2} e^{\left (6 i \, f x + 6 i \, e\right )} - 50 i \, A a^{3} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} - 10 \, B a^{3} c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} - 25 i \, A a^{3} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 5 \, B a^{3} c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 5 i \, A a^{3} c^{2} - B a^{3} c^{2}\right )}}{15 \, {\left (f e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.42, size = 108, normalized size = 1.07 \begin {gather*} \frac {A\,a^3\,c^2\,\mathrm {tan}\left (e+f\,x\right )-\frac {a^3\,c^2\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (-B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}+\frac {a^3\,c^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (A-B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {a^3\,c^2\,{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (A-B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4}+\frac {B\,a^3\,c^2\,{\mathrm {tan}\left (e+f\,x\right )}^5\,1{}\mathrm {i}}{5}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________